home *** CD-ROM | disk | FTP | other *** search
- /* Name: Reposition
- ** Author: Paul Manias
- ** Copyright: DreamWorld Productions (c) 1996-1997. Freely distributable.
- **
- ** This example has a mobile 320x256 screen, which is attached to the
- ** mouse. To exit the example, press LMB.
- */
-
- MODULE 'dpkernel','dpkernel/dpkernel','graphics/pictures','files/files'
- MODULE 'screens','system/register','system/modules','input/joydata'
- MODULE 'graphics/screens','graphics/blitter'
-
- PROC main()
- DEF screen :PTR TO screen,
- joy :PTR TO joydata,
- pic :PTR TO picture,
- scrmodule :PTR TO module,
- picfile :filename
-
- picfile := [ ID_FILENAME, 'GMS:demos/data/PIC.Green']:filename
-
- IF dpkbase := OpenLibrary('GMS:libs/dpkernel.library',0)
- IF (scrmodule := Init([TAGS_MODULE,NIL,
- MODA_NUMBER, MOD_SCREENS,
- MODA_TABLETYPE, JMP_AMIGAE,
- TAGEND], NIL))
-
- scrbase := scrmodule.modbase
-
- IF (pic := Load(picfile,ID_PICTURE))
- screen := Get(ID_SCREEN)
- CopyStructure(pic,screen)
- screen.memptr1 := pic.bitmap.data
- screen.attrib := CENTRE
-
- IF (screen := Init(screen,NIL))
- IF (joy := Init(Get(ID_JOYDATA),NIL))
- Display(screen)
- REPEAT
- Query(joy)
- screen.xoffset := screen.xoffset + joy.xchange
- screen.yoffset := screen.yoffset + joy.ychange
- WaitAVBL()
- RemakeScreen(screen)
- UNTIL !(joy.buttons AND JD_LMB)
- Free(joy)
- ENDIF
- Free(screen)
- ENDIF
- Free(pic)
- ENDIF
- Free(scrmodule)
- ENDIF
- CloseDPK()
- ENDIF
- ENDPROC
-
-